package com.sjlh.centurylianhua.controller;

import com.sjlh.centurylianhua.entity.PurchaseLogInfo;
import com.sjlh.centurylianhua.entity.RefundLogInfo;
import com.sjlh.centurylianhua.mapper.RefundLogInfoMapper;
import com.sjlh.centurylianhua.utils.ResultData;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@CrossOrigin
@RestController
@RequestMapping("/refundInfo")
public class RefundInfoController {
    @Resource
    private RefundLogInfoMapper refundLogInfoMapper;

    /**
     * 添加退货日志详情
     * */
    @RequestMapping("/add")
    public Object add(@RequestBody RefundLogInfo refundLogInfo) {
        long r=refundLogInfoMapper.insert(refundLogInfo);
        if (r==1){
            return new ResultData(true,20000,"添加成功",true,null);
        }else {
            return new ResultData(false,20001,"添加失败",false,null);
        }
    }
}
